export interface ICountry {
  name: string;
  code: string;
  flag: string;
  countryCode: string;
  center?: {
    lat: number;
    lng: number;
  };
  bounds: {
    minLat: number;
    maxLat: number;
    minLng: number;
    maxLng: number;
  };
  children?: string[];
  parent?: string;
}

export const COUNTRIES_LIST: ICountry[] = [
  // 1. 中国及港澳台（4条）
  {
    name: '中国',
    code: '+86',
    flag: 'https://flagcdn.com/w320/cn.png',
    countryCode: 'CN',
    center: { lat: 35.8617, lng: 104.1954 },
    bounds: {
      minLat: 3.8628,
      maxLat: 53.5503,
      minLng: 73.6589,
      maxLng: 135.0472
    },
    children: ['TW', 'HK', 'MO']
  },
  {
    name: '日本',
    code: '+81',
    flag: 'https://flagcdn.com/w320/jp.png',
    countryCode: 'JP',
    center: { lat: 36.2048, lng: 138.2529 },
    bounds: {
      minLat: 20.4264,
      maxLat: 45.5348,
      minLng: 122.9245,
      maxLng: 145.8015
    }
  },
  {
    name: '대한민국',
    code: '+82',
    flag: 'https://flagcdn.com/w320/kr.png',
    countryCode: 'KR',
    center: { lat: 36.5248, lng: 127.7669 },
    bounds: {
      minLat: 33.0007,
      maxLat: 38.7527,
      minLng: 124.4728,
      maxLng: 131.0043
    }
  },
  {
    name: '中國台灣',
    code: '+886',
    flag: 'https://flagcdn.com/w320/tw.png',
    countryCode: 'TW',
    center: { lat: 23.6048, lng: 120.9699 },
    bounds: {
      minLat: 21.9713,
      maxLat: 25.3433,
      minLng: 119.5435,
      maxLng: 122.0073
    },
    parent: 'CN'
  },
  {
    name: '中國香港',
    code: '+852',
    flag: 'https://flagcdn.com/w320/hk.png',
    countryCode: 'HK',
    center: { lat: 22.3193, lng: 114.1694 },
    bounds: {
      minLat: 22.1502,
      maxLat: 22.5237,
      minLng: 113.9768,
      maxLng: 114.3775
    },
    parent: 'CN'
  },
  {
    name: '中國澳門',
    code: '+853',
    flag: 'https://flagcdn.com/w320/mo.png',
    countryCode: 'MO',
    center: { lat: 22.1989, lng: 113.5431 },
    bounds: {
      minLat: 22.1458,
      maxLat: 22.2343,
      minLng: 113.4902,
      maxLng: 113.5787
    },
    parent: 'CN'
  },

  // 2. 美洲（2条）
  {
    name: 'United States',
    code: '+1',
    flag: 'https://flagcdn.com/w320/us.png',
    countryCode: 'US',
    center: { lat: 39.8334, lng: -98.5835 },
    bounds: {
      minLat: 24.5229,
      maxLat: 49.3457,
      minLng: -124.7844,
      maxLng: -66.9498
    }
  },
  {
    name: 'Canada',
    code: '+1',
    flag: 'https://flagcdn.com/w320/ca.png',
    countryCode: 'CA',
    center: { lat: 56.1304, lng: -106.3468 },
    bounds: {
      minLat: 41.6992,
      maxLat: 83.1198,
      minLng: -141.0,
      maxLng: -52.6334
    }
  },

  // 3. 大洋洲（2条）
  {
    name: 'Australia',
    code: '+61',
    flag: 'https://flagcdn.com/w320/au.png',
    countryCode: 'AU',
    center: { lat: -25.2744, lng: 133.7751 },
    bounds: {
      minLat: -43.6085,
      maxLat: -10.608,
      minLng: 113.1707,
      maxLng: 153.6078
    }
  },
  {
    name: 'New Zealand',
    code: '+64',
    flag: 'https://flagcdn.com/w320/nz.png',
    countryCode: 'NZ',
    center: { lat: -40.9006, lng: 174.8859 },
    bounds: {
      minLat: -47.0201,
      maxLat: -34.3698,
      minLng: 166.5803,
      maxLng: 178.084
    }
  },

  // 4. 欧洲（12条）
  {
    name: 'Argentina',
    code: '+54',
    flag: 'https://flagcdn.com/w320/ar.png',
    countryCode: 'AR',
    center: { lat: -38.4161, lng: -63.6167 },
    bounds: {
      minLat: -55.3781,
      maxLat: -21.8943,
      minLng: -73.3024,
      maxLng: -53.7672
    }
  },
  {
    name: 'Austria',
    code: '+43',
    flag: 'https://flagcdn.com/w320/at.png',
    countryCode: 'AT',
    center: { lat: 47.5162, lng: 14.5501 },
    bounds: {
      minLat: 46.3355,
      maxLat: 48.5699,
      minLng: 12.1663,
      maxLng: 16.6614
    }
  },
  {
    name: 'Belgium',
    code: '+32',
    flag: 'https://flagcdn.com/w320/be.png',
    countryCode: 'BE',
    center: { lat: 50.5039, lng: 4.4699 },
    bounds: {
      minLat: 49.4531,
      maxLat: 51.3098,
      minLng: 2.3159,
      maxLng: 6.3648
    }
  },
  {
    name: 'Brasil',
    code: '+55',
    flag: 'https://flagcdn.com/w320/br.png',
    countryCode: 'BR',
    center: { lat: -14.235, lng: -51.9253 },
    bounds: {
      minLat: -33.7326,
      maxLat: 5.1992,
      minLng: -73.9833,
      maxLng: -34.8828
    }
  },
  {
    name: 'Chile',
    code: '+56',
    flag: 'https://flagcdn.com/w320/cl.png',
    countryCode: 'CL',
    center: { lat: -35.6752, lng: -71.5429 },
    bounds: {
      minLat: -56.9217,
      maxLat: -17.5635,
      minLng: -75.7047,
      maxLng: -66.1406
    }
  },
  {
    name: 'Denmark',
    code: '+45',
    flag: 'https://flagcdn.com/w320/dk.png',
    countryCode: 'DK',
    center: { lat: 56.2639, lng: 9.5018 },
    bounds: {
      minLat: 54.6756,
      maxLat: 57.7493,
      minLng: 8.2474,
      maxLng: 15.0103
    }
  },
  {
    name: 'Finland',
    code: '+358',
    flag: 'https://flagcdn.com/w320/fi.png',
    countryCode: 'FI',
    center: { lat: 61.9241, lng: 25.7482 },
    bounds: {
      minLat: 59.9407,
      maxLat: 70.1693,
      minLng: 20.6768,
      maxLng: 31.8793
    }
  },
  {
    name: 'France',
    code: '+33',
    flag: 'https://flagcdn.com/w320/fr.png',
    countryCode: 'FR',
    center: { lat: 46.2276, lng: 2.2137 },
    bounds: {
      minLat: 41.3057,
      maxLat: 51.0501,
      minLng: -5.1428,
      maxLng: 9.5146
    }
  },
  {
    name: 'Deutschland',
    code: '+49',
    flag: 'https://flagcdn.com/w320/de.png',
    countryCode: 'DE',
    center: { lat: 51.1657, lng: 10.4515 },
    bounds: {
      minLat: 47.2791,
      maxLat: 55.0368,
      minLng: 5.8608,
      maxLng: 15.0416
    }
  },
  {
    name: 'Ελλάδα',
    code: '+30',
    flag: 'https://flagcdn.com/w320/gr.png',
    countryCode: 'GR',
    center: { lat: 39.0742, lng: 21.8243 },
    bounds: {
      minLat: 35.3543,
      maxLat: 41.8656,
      minLng: 19.0742,
      maxLng: 28.3698
    }
  },
  {
    name: 'Magyarország',
    code: '+36',
    flag: 'https://flagcdn.com/w320/hu.png',
    countryCode: 'HU',
    center: { lat: 47.1625, lng: 19.5033 },
    bounds: {
      minLat: 45.7038,
      maxLat: 48.5635,
      minLng: 16.1506,
      maxLng: 22.9378
    }
  },
  {
    name: '冰岛',
    code: '+354',
    flag: 'https://flagcdn.com/w320/is.png',
    countryCode: 'IS',
    center: { lat: 64.9631, lng: -19.0208 },
    bounds: {
      minLat: 63.2931,
      maxLat: 66.5691,
      minLng: -24.3334,
      maxLng: -13.6667
    }
  },

  // 5. 亚洲（10条）
  {
    name: 'India भारत',
    code: '+91',
    flag: 'https://flagcdn.com/w320/in.png',
    countryCode: 'IN',
    center: { lat: 20.5937, lng: 78.9629 },
    bounds: {
      minLat: 8.0782,
      maxLat: 37.7749,
      minLng: 68.1556,
      maxLng: 97.3956
    }
  },
  {
    name: 'Indonesia',
    code: '+62',
    flag: 'https://flagcdn.com/w320/id.png',
    countryCode: 'ID',
    center: { lat: -0.7893, lng: 113.9213 },
    bounds: {
      minLat: -11.2712,
      maxLat: 6.1751,
      minLng: 94.2728,
      maxLng: 141.0722
    }
  },
  {
    name: 'Italia',
    code: '+39',
    flag: 'https://flagcdn.com/w320/it.png',
    countryCode: 'IT',
    center: { lat: 41.8719, lng: 12.5674 },
    bounds: {
      minLat: 35.5085,
      maxLat: 47.0399,
      minLng: 6.6236,
      maxLng: 18.5285
    }
  },
  {
    name: 'ປະເທດລາວ',
    code: '+856',
    flag: 'https://flagcdn.com/w320/la.png',
    countryCode: 'LA',
    center: { lat: 19.8563, lng: 102.4991 },
    bounds: {
      minLat: 14.6542,
      maxLat: 23.7387,
      minLng: 100.0443,
      maxLng: 107.8739
    }
  },
  {
    name: 'Malaysia',
    code: '+60',
    flag: 'https://flagcdn.com/w320/my.png',
    countryCode: 'MY',
    center: { lat: 4.2105, lng: 101.9757 },
    bounds: {
      minLat: 1.2893,
      maxLat: 6.6543,
      minLng: 100.3194,
      maxLng: 119.0136
    }
  },
  {
    name: 'Myanmar မြန်မာ',
    code: '+95',
    flag: 'https://flagcdn.com/w320/mm.png',
    countryCode: 'MM',
    center: { lat: 21.9139, lng: 95.9562 },
    bounds: {
      minLat: 9.6734,
      maxLat: 28.3608,
      minLng: 92.2218,
      maxLng: 101.7002
    }
  },
  {
    name: 'Nederland',
    code: '+31',
    flag: 'https://flagcdn.com/w320/nl.png',
    countryCode: 'NL',
    center: { lat: 52.1326, lng: 5.2913 },
    bounds: {
      minLat: 50.7488,
      maxLat: 53.5499,
      minLng: 3.2186,
      maxLng: 7.2235
    }
  },
  {
    name: 'Norway',
    code: '+47',
    flag: 'https://flagcdn.com/w320/no.png',
    countryCode: 'NO',
    center: { lat: 60.472, lng: 8.4689 },
    bounds: {
      minLat: 57.0267,
      maxLat: 71.0007,
      minLng: 4.7161,
      maxLng: 31.0093
    }
  },
  {
    name: 'Philippine',
    code: '+63',
    flag: 'https://flagcdn.com/w320/ph.png',
    countryCode: 'PH',
    center: { lat: 12.8797, lng: 121.774 },
    bounds: {
      minLat: 4.0667,
      maxLat: 21.8568,
      minLng: 116.4013,
      maxLng: 126.3449
    }
  },
  {
    name: 'Singapore',
    code: '+65',
    flag: 'https://flagcdn.com/w320/sg.png',
    countryCode: 'SG',
    center: { lat: 1.3521, lng: 103.8198 },
    bounds: {
      minLat: 1.2272,
      maxLat: 1.4789,
      minLng: 103.6869,
      maxLng: 104.0013
    }
  },

  // 6. 中东/非洲（3条）
  {
    name: 'Egypt مصر',
    code: '+20',
    flag: 'https://flagcdn.com/w320/eg.png',
    countryCode: 'EG',
    center: { lat: 26.8206, lng: 30.8025 },
    bounds: {
      minLat: 21.0007,
      maxLat: 31.5992,
      minLng: 24.8728,
      maxLng: 35.9028
    }
  },
  {
    name: 'Poland',
    code: '+48',
    flag: 'https://flagcdn.com/w320/pl.png',
    countryCode: 'PL',
    center: { lat: 51.9194, lng: 19.1451 },
    bounds: {
      minLat: 49.0087,
      maxLat: 54.9054,
      minLng: 14.0898,
      maxLng: 24.1663
    }
  },
  {
    name: 'Portugal',
    code: '+351',
    flag: 'https://flagcdn.com/w320/pt.png',
    countryCode: 'PT',
    center: { lat: 39.3998, lng: -8.2245 },
    bounds: {
      minLat: 36.9177,
      maxLat: 42.0265,
      minLng: -9.5278,
      maxLng: -6.1028
    }
  },
  {
    name: 'Russia',
    code: '+7',
    flag: 'https://flagcdn.com/w320/ru.png',
    countryCode: 'RU',
    center: { lat: 61.524, lng: 105.3188 },
    bounds: {
      minLat: 41.4995,
      maxLat: 81.5992,
      minLng: 19.3857,
      maxLng: 169.0166
    }
  },
  {
    name: 'Thailand',
    code: '+66',
    flag: 'https://flagcdn.com/w320/th.png',
    countryCode: 'TH',
    center: { lat: 15.87, lng: 100.9925 },
    bounds: {
      minLat: 5.0013,
      maxLat: 20.8246,
      minLng: 97.3006,
      maxLng: 105.6066
    }
  },
  {
    name: 'U.K.',
    code: '+44',
    flag: 'https://flagcdn.com/w320/gb.png',
    countryCode: 'GB',
    center: { lat: 55.3781, lng: -3.436 },
    bounds: {
      minLat: 49.9501,
      maxLat: 60.9452,
      minLng: -8.6149,
      maxLng: 1.7707
    }
  },
  {
    name: 'Vietnam',
    code: '+84',
    flag: 'https://flagcdn.com/w320/vn.png',
    countryCode: 'VN',
    center: { lat: 14.0583, lng: 108.2772 },
    bounds: {
      minLat: 8.4848,
      maxLat: 23.2317,
      minLng: 102.0,
      maxLng: 109.2784
    }
  }
];
